<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <div class="top">上一个</div>
    <div class="center">中间</div>
    <div class="bottom">下一个</div>

    <script>
        /*
        兄弟节点查找：
            nextElementSibling 下一个兄弟元素节点
            previousElementSibling 上一个兄弟元素节点
         */
        const center = document.querySelector(".center")
        console.log(center.previousElementSibling);
        console.log(center.previousSibling);

        console.log(center.nextElementSibling);
        console.log(center.nextSibling);
    </script>
</body>

</html>